Skip to content

Bug fixes for working with .PGNs that contain FEN position tags.#58

Merged
CorentinGS merged 4 commits intoCorentinGS:mainfrom
mikeb26:fromPosBugfixes
Jul 12, 2025
Merged

Bug fixes for working with .PGNs that contain FEN position tags.#58
CorentinGS merged 4 commits intoCorentinGS:mainfrom
mikeb26:fromPosBugfixes

Conversation

@mikeb26
Copy link
Contributor

@mikeb26 mikeb26 commented Jul 12, 2025

While working on replacing notnil/chess with corentings/chess in mikeb26/chesstools I ran into a handful of bugs related to .PGNs containing FEN position tags. These 3 bug fixes address the issues I found.

mikeb26 and others added 4 commits July 12, 2025 14:11
When parsing a game which includes both a FEN position tag and
variations, parseVariation() should use the rootMove's position rather
than assume the starting position.
When a Game is constructed from a .pgn containing a FEN, the parsed
moves may not begin at move 1. Similarly, the player to move cannot be
assumed to be white. This commit fixes both by using the rootMove's
position to determine both the initial move number to output and the turn.
@CorentinGS CorentinGS merged commit 5ad7e6e into CorentinGS:main Jul 12, 2025
6 checks passed
@mikeb26 mikeb26 deleted the fromPosBugfixes branch July 12, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants